<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@   taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html >
<html>
<head>
	<base href="<%=basePath%>">
     <meta charset="utf-8">

        <title> Lexy - 发表文章 </title>

　　<meta name="keywords" content="lexy,Lexyui,lexyui,lexy博客"> 
        <meta name="description" content="lexy 博客站">
        <meta name="author" content="lexy">
        <meta name="robots" content="noindex, nofollow">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <!-- Icons -->
        <!-- The following icons can be replaced with your own, they are used by desktop and mobile browsers -->
        <link rel="shortcut icon" href="plugins/v2/img/favicons/favicon.png">

        <link rel="icon" type="image/png" href="plugins/v2/img/favicons/favicon-16x16.png" sizes="16x16">
        <link rel="icon" type="image/png" href="plugins/v2/img/favicons/favicon-32x32.png" sizes="32x32">
        <link rel="icon" type="image/png" href="plugins/v2/img/favicons/favicon-96x96.png" sizes="96x96">
        <link rel="icon" type="image/png" href="plugins/v2/img/favicons/favicon-160x160.png" sizes="160x160">
        <link rel="icon" type="image/png" href="plugins/v2/img/favicons/favicon-192x192.png" sizes="192x192">

        <link rel="apple-touch-icon" sizes="57x57" href="plugins/v2/img/favicons/apple-touch-icon-57x57.png">
        <link rel="apple-touch-icon" sizes="60x60" href="plugins/v2/img/favicons/apple-touch-icon-60x60.png">
        <link rel="apple-touch-icon" sizes="72x72" href="plugins/v2/img/favicons/apple-touch-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="76x76" href="plugins/v2/img/favicons/apple-touch-icon-76x76.png">
        <link rel="apple-touch-icon" sizes="114x114" href="plugins/v2/img/favicons/apple-touch-icon-114x114.png">
        <link rel="apple-touch-icon" sizes="120x120" href="plugins/v2/img/favicons/apple-touch-icon-120x120.png">
        <link rel="apple-touch-icon" sizes="144x144" href="plugins/v2/img/favicons/apple-touch-icon-144x144.png">
        <link rel="apple-touch-icon" sizes="152x152" href="plugins/v2/img/favicons/apple-touch-icon-152x152.png">
        <link rel="apple-touch-icon" sizes="180x180" href="plugins/v2/img/favicons/apple-touch-icon-180x180.png">
        <!-- END Icons -->

        <!-- Stylesheets -->
        <!-- Web fonts -->
        <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400italic,600,700%7COpen+Sans:300,400,400italic,600,700">
		
		<!-- Page JS Plugins CSS -->
        <link rel="stylesheet" href="plugins/v2/js/plugins/datatables/jquery.dataTables.min.css">


        <!-- Bootstrap and OneUI CSS framework -->
        <link rel="stylesheet" href="plugins/v2/css/bootstrap.min.css">
        <link rel="stylesheet" id="css-main" href="plugins/v2/css/oneui.css">

        <!-- You can include a specific file from css/themes/ folder to alter the default color theme of the template. eg: -->
        <!-- <link rel="stylesheet" id="css-theme" href="plugins/v2/css/themes/flat.min.css"> -->
        <!-- END Stylesheets -->
        
        
        <style type="text/css">
        .block-content.block-content-narrow {
		    padding-left: 15%;
		    padding-right: 15%;
		}

        
        </style>
        
        
        
    </head>
     <body>
        <!-- Page Container -->

        <div id="page-container" class="sidebar-l sidebar-o side-scroll header-navbar-fixed">
          
			 <!-- Side Overlay-->
            <jsp:include page="com/_right_sidebar.jsp"></jsp:include>
            <!-- END Side Overlay -->

            <!-- Sidebar -->
           <jsp:include page="com/_left_sidebar.jsp"></jsp:include>
            <!-- END Sidebar -->
            

            <!-- Header -->
            <jsp:include page="com/_top_tools.jsp"></jsp:include>
            <!-- END Header -->
            
            
            
           

            <!-- Main Container -->
            <main id="main-container">
                <!-- Page Header -->
                <div class="content bg-gray-lighter">
                    <div class="row items-push">
                        <div class="col-sm-7">
                            <h1 class="page-heading">
                                系统参数 <small>系统固定参数(<span style="color:red">注：添加之后需要刷新</span>)</small>
                            </h1>
                        </div>
                        <div class="col-sm-5 text-right hidden-xs">
                            <ol class="breadcrumb push-10-t">
                                <li>Tables</li>
                                <li><a class="link-effect" href="">DataTables</a></li>
                            </ol>
                        </div>
                    </div>
                </div>
                <!-- END Page Header -->

                <!-- Page Content -->
                <div class="content ">
                    <!-- Dynamic Table Full -->
                    <div id="block_sys_enums" class="block block-bordered">
                       <div class="block-header bg-gray-lighter">
                                    <ul class="block-options">
                                    	<li>
                                    		<!-- <button type="button"><i  onclick="openModal()" class="si si-refresh"></i></button> -->
                                    		<button type="button"   onclick="refreshDataTable();"><i class="si si-refresh"></i></button>
                                    	</li>
                                        <li>
                                            <button type="button"><i  onclick="openModal()" class="si si-plus"></i></button>
                                        </li>
                                    </ul>
                                    <h3 class="block-title">系统参数</h3>
                                </div>
                        <div class="block-content  " >
                            <!-- DataTables init on table by adding .js-dataTable-full class, functionality initialized in js/pages/base_tables_datatables.js -->
                            <table id="example" class="table table-bordered table-striped js-dataTable-full">
                                <thead>
                                    <tr>
                                        <th class="text-center   hidden-xs" >Id</th>
                                        <th>MainKey</th>
                                        <th class="hidden-xs">eKey</th>
                                        <th class="hidden-xs" style="width: 15%;">eKeyDes</th>
                                        <th class="text-center" style="width: 20%;">eValue</th>
                                        <th class="text-center hidden-xs" style="width: 10%;">操作人</th>
                                        <th class="text-center hidden-xs" style="width: 10%;">更新时间</th>
                                        <th class="text-center" style="width: 10%;">操作</th>
                                    </tr>
                                </thead>
                                
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- END Dynamic Table Full -->

                    
                </div>
                <!-- END Page Content -->
            </main>
            <!-- END Main Container -->

            <!-- Footer -->
            <footer id="page-footer" class="content-mini content-mini-full font-s12 bg-gray-lighter clearfix">
                <div class="pull-right">
                    Crafted with <i class="fa fa-heart text-city"></i> by <a class="font-w600"  target="_blank">lexy</a>
                </div>
            </footer>
            <!-- END Footer -->
        </div>
        <!-- END Page Container -->

        <!-- Apps Modal -->
        <!-- Opens from the button in the header -->
        <div class="modal fade" id="apps-modal" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-sm modal-dialog modal-dialog-top">
                <div class="modal-content">
                    <!-- Apps Block -->
                    <div class="block block-themed block-transparent">
                        <div class="block-header bg-primary-dark">
                            <ul class="block-options">
                                <li>
                                    <button data-dismiss="modal" type="button"><i class="si si-close"></i></button>
                                </li>
                            </ul>
                            <h3 class="block-title">应用</h3>
                        </div>
                        <div class="block-content">
                            <div class="row text-center">
                                <div class="col-xs-6">
                                    <a class="block block-rounded" href="http://lexy.ga/v2/admin"   target="view_window" >
                                        <div class="block-content text-white bg-default">
                                            <i class="si si-speedometer fa-2x"></i>
                                            <div class="font-w600 push-15-t push-15">后台系统</div>
                                        </div>
                                    </a>
                                </div>
                                <div class="col-xs-6">
                                    <a class="block block-rounded" href="http://lexy.ga"  target="view_window">
                                        <div class="block-content text-white bg-modern">
                                            <i class="si si-rocket fa-2x"></i>
                                            <div class="font-w600 push-15-t push-15">前台网站</div>
                                        </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- END Apps Block -->
                </div>
            </div>
        </div>
        <!-- END Apps Modal -->
        
        
        
        
       <!-- add/edit modal -->
        
        
        <div class="modal fade" id="modal-fadein" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
            <div class="modal-dialog modal-lg"  >
                <div class="modal-content">
                    <div class="block block-themed block-transparent remove-margin-b">
                        <div class="block-header bg-primary-dark">
                            <ul class="block-options">
                                <li>
                                    <button data-dismiss="modal" type="button"><i class="si si-close"></i></button>
                                </li>
                            </ul>
                            <h3 class="block-title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"><span id="modal-title">编辑</span></font></font></h3>
                        </div>
                        <div class="block-content">
                        
                        
                        	<div class="block-content block-content-narrow">
                        			<form class="form-horizontal push-10-t center"   id="sys-enums-form" onsubmit="return false;">
                                        <div class="form-group">
                                            <div class="col-sm-12">
                                                <div class="form-material">
                                                    <input class="form-control" type="text" id="mainKey" name="mainKey" placeholder="请输入参数Key值...">
                                                    <label for="material-text"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">MainKey</font></font></label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-12">
                                                <div class="form-material">
                                                    <input class="form-control" type="text" id="eKey" name="eKey" placeholder=" 请输入参数Key值...">
                                                    <label for="material-password"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">eKey</font></font></label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-12">
                                                <div class="form-material">
                                                    <input class="form-control" type="text" id="eKeyDesc" name="eKeyDesc" placeholder=" 请输入参数描述...">
                                                    <label for="material-password"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">eKeyDesc</font></font></label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-md-12">
                                                <div class="form-material">
                                                    <textarea class="js-maxlength form-control" id="eValue" name="eValue" rows="8" maxlength="100" placeholder=" 请输入参数值..." data-always-show="true"></textarea>
                                                    <label for="example-material-maxlength7">eValue</label>
                                                </div>
                                            </div>
                                        </div>
                                        <input type="hidden"  name="serialId"  id="serialId">
                                    </form>
                        	</div>
                        
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button class="btn btn-sm btn-default" type="button" data-dismiss="modal"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">取消</font></font></button>
                        <button class="btn btn-sm btn-primary" type="button"  id="btn-submit-form" onclick=""><i class="fa fa-check"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 确定</font></font></button>
                    </div>
                </div>
            </div>
        </div>
        
        <!--  -->
        
        
        
        
        
        
        
        
        
        
        

        <!-- OneUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock, Appear, CountTo, Placeholder, Cookie and App.js -->
        <script src="plugins/v2/js/core/jquery.min.js"></script>
        <script src="plugins/v2/js/core/bootstrap.min.js"></script>
        <script src="plugins/v2/js/core/jquery.slimscroll.min.js"></script>
        <script src="plugins/v2/js/core/jquery.scrollLock.min.js"></script>
        <script src="plugins/v2/js/core/jquery.appear.min.js"></script>
        <script src="plugins/v2/js/core/jquery.countTo.min.js"></script>
        <script src="plugins/v2/js/core/jquery.placeholder.min.js"></script>
        <script src="plugins/v2/js/core/js.cookie.min.js"></script>
        <script src="plugins/v2/js/app.js"></script>
        <script src="plugins/v2/js/pub.js"></script>

        <!-- Page JS Plugins -->
        <script src="plugins/v2/js/plugins/datatables/jquery.dataTables.min.js"></script>

        <!-- Page JS Code -->
        <script src="admin/v2/js/pages/page-enums.js"></script>
        <script type="text/javascript">
        $(function(){
        	BaseTableDatatables.init();
        	
           	$("#menu-sys-setting").addClass("open");
           	$("#menu-fixed-param").addClass("active");

        })
        
        function openModal(){
        	$('#modal-fadein').modal('show');
        	$("#mainKey").val("");
    		$("#eKey").val("");
    		$("#eKeyDesc").val("");
    		$("#eValue").val("");
    		
    		$("#btn-submit-form").attr("onclick" , "insertSysEnums()")
    		
    		
    		
    		
       	}
        	
        
        function refreshDataTable(){
        	var data = doPost("v2/admin/par/refreshSysEnums" ,"");
        	if("200"==data.code){
        		var table = $('#example').DataTable();
	   			table.draw( false );
	        	//App.blocks('#block_sys_enums', 'state_normal');
        	}
        }
        	
        function insertSysEnums(){
        	var formVal = $("#sys-enums-form").serializeJsonStr();
        	var data = doPost("v2/admin/par/insertSysEnums" , "reqStr="+formVal);
        	if("200"==data.code){
            	$('#modal-fadein').modal('hide');
        		//BaseTableDatatables.init();
        		refreshDataTable();
        	}
        }
        
        function updateSysEnums(){
        	var formVal = $("#sys-enums-form").serializeJsonStr();
        	var data = doPost("v2/admin/par/updateSysEnums" , "reqStr="+formVal);
        	if("200"==data.code){
            	$('#modal-fadein').modal('hide');
        		//BaseTableDatatables.init();
        		refreshDataTable();
        	}
        }
        
        function  editEnumDetail(id){
        		var result = doPost("v2/admin/getSysEnumsInfo","id="+id);
        		if(result!=null){
        			openModal();
	        		$("#mainKey").val(result.detail.main_key);
	        		$("#eKey").val(result.detail.e_key);
	        		$("#eKeyDesc").val(result.detail.e_key_desc);
	        		$("#eValue").val(result.detail.e_value);
	        		$("#serialId").val(result.detail.serial_id);
	        		$("#btn-submit-form").attr("onclick" , "updateSysEnums()");
        		}
        		
       	}
        
        
        var sUserAgent = navigator.userAgent.toLowerCase();
        var pc=sUserAgent.match(/windows/i) == "windows";
        if(pc){
            console.log('当前是pc');
        }else{
            console.log('当前是phone');
        }
        
        </script>
        
        
        
        
    </body>
</html>